/*
 * @Author: 吴世扬 18368095041@163.com
 * @Date: 2025-02-21 17:37:24
 * @LastEditors: 吴世扬 18368095041@163.com
 * @LastEditTime: 2025-02-25 16:03:59
 * @FilePath: /vue3-admin-server/src/common/dto/file.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { IsString, IsEnum, IsNotEmpty } from 'class-validator';
import { Transform } from 'class-transformer';

import { FileTypeEnum } from 'src/common/constants';
export class UploadFileDTO {
    @IsString({ message: '文件所属模块为字符串' })
    bucket?: string;

    @IsString({ message: '文件备注为字符串' })
    remark?: string;

    @Transform((params) => {
        return Number(params.value);
    })
    @IsEnum(FileTypeEnum, { message: '文件类型必须是有效的文件类型枚举值' })
    @IsNotEmpty({ message: '文件类型不能为空' })
    type: number;
}
